package com.eliota.service.impl;

import com.eliota.entity.Device;
import com.eliota.mapper.DeviceMapper;
import com.eliota.service.DeviceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author MG
 * @since 2023-04-01
 */
@Service
public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> implements DeviceService {

    @Resource
    public DeviceMapper deviceMapper;


    /**
     * 借出设置为1
     * @param id
     */
    @Override
    public void deleteById(Integer id) {
        deviceMapper.updateStatus(id);
    }

    @Override
    public void deleteBatchByIds(List<Integer> ids) {
        for (Integer id : ids) {
            deviceMapper.updateStatus(id);
        }
    }


}
